"""A simple bootstrap for other Juggle programs.
"""

import os
import string

what_now = "s"
while what_now != "x":
    os.system(['clear','cls'][os.name == 'nt'])
    print ""
    print " Juggle Trainer"
    print " **************"
    print ""
    print " So, what would you like to do now?"
    print ""
    print " " + string.ljust("[p] Practise random patterns", 33) + string.ljust("[x] Exit", 35)
    print " [g] Grade patterns"
    print " [a] Analyze grades"
    what_now = raw_input("? ").lower()
    while what_now not in ["p", "g", "a", "j", "x"]:
        what_now = raw_input("   Oops! This is not a valid keystroke. Let's try again...")
    if what_now == "g":
        execfile("juggle_belfre.py")
    elif what_now == "p":
        execfile("juggle_shuffle.py")
    elif what_now == "a":
        execfile("juggle_analyze.py")
    elif what_now == "j":
        execfile("janitor.py")
    else:
        pass

print ""
print "Bye bye!"
print ""
